<?php
/**
 * <https://y.st./>
 * Copyright © 2017 Alex Yst <mailto:copyright@y.st>
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <https://www.gnu.org./licenses/>.
**/

$xhtml = array(
	'title' => 'New ideas for <code>minequest</code>',
	'body' => <<<END
<section id="general">
	<h2>General news</h2>
	<p>
		I&apos;m considering giving all my shift leaders code names.
		It&apos;d make it easier to discus life at work in a coherent way.
		I could more easily remember who did what and reader&apos;d be able to start understanding the personalities I interact with.
		I might give code names to non-management too, if they are of particular interest.
		For example, Daddy Gummy Bear isn&apos;t a shift leader.
		The head manager probably won&apos;t have a code name beyond &quot;head manager&quot; though.
		They title alone uniquely distinguishes them from my other coworkers.
	</p>
	<p>
		At work today, I came up with a way to improve my <code>minequest</code> mod.
		After having collected enough of a given &quot;mineral&quot;, a special inventory slot will open up that can only accept an item made with that &quot;mineral&quot;.
		The number will be low.
		However, based on the item you put in that slot, you&apos;ll get some sort of bonus for as long as you keep it there.
		The bonus will become better as you collect more and more of the relevant mineral.
		The bonus for the two types of coral will probably be something negative, most likely death or injury.
		The others will be positive.
		A locked chest will give you more inventory space.
		A steel door or steel trapdoor (I haven&apos;t decided which yet) will probably offer you settable warp points.
		The steel bottle item will probably have something to do with healing you.
		The higher you raise your iron mineral stat, the more health it&apos;ll heal you by when you use it and the more times you can use it before refilling at a lake or ocean.
		Some coal-related item will provide you with a portable furnace, one that ironically can&apos;t burn coal.
		In the initial concept I came up with, a specific item fit each slot, it wasn&apos;t just any item made from that mineral.
		In that version, the locked chest was the steel item and the furnace (which isn&apos;t made from coal) was the coal item.
		I like the option to choose which bonuses you get better though.
		It will mean more effort on my part though.
		I&apos;ll need to come up with a bonus for each item made with one of the stat-relevant nodes.
		In some cases, I&apos;ll need to come up with <strong>*two*</strong> bonuses for the item.
		For example, the flint and steel tool is made by combining flint and steel.
		Thus, it&apos;ll grant one bonus if used in the flint slot and one if used in the iron slot.
		Some items will be more of a challenge to come up with relevant bonuses for, such as shovels, but at the same time, the shovels can&apos;t change slots.
		For that reason, I think it&apos;s fine to reuse the bonuses they grant for each other.
		For example, all the shovels could grant the same bonus.
		At that point, you can either stack the bonuses if you use multiple shovels or you could choose which slot had the least appealing non-shovel bonuses, and stick the shovel in that slot.
	</p>
	<p>
		I also came to realise something else about the <code>minequest</code> mod.
		It stores integers in a file, which is fine and good, except that Lua doesn&apos;t have an integer type.
		(New versions of Lua actually do if compiled to have them, but not the version used by Minetest.)
		Lua&apos;s float precision is fine to a point, and I kind of found somewhere near that point for my player name hash algorithm.
		However, that&apos;s beyond the point when Lua&apos;s string representations of integer-looking floats stops looking like integers.
		At that point, storage of the integers becomes imprecise, despite Lua still having decent precision for them internally.
		I&apos;m going to need to cap the stat growth at that point, and loop it around if I think that&apos;s not high enough.
		A second stat can keep track of the number of times we&apos;ve had to loop back, essentially adding more digits to our number.
		I considered starting out negative, at the lower limit of this precision, and incriminating up to the positive limit.
		That would essentially give me another &quot;bit&quot; to work with!
		However, I later decided against this idea.
		I think the point Lua loses integer-storage precision lies on one of the base-ten lines.
		Using a binary bit in the middle of base-ten storage adds needless complexity.
		I&apos;ll stick with positive integers.
	</p>
	<p>
		After I figure out how precisely I can store integers, or rather, how many digits I can store precisely, I might redo my hashing algorithm to use that same precision for consistency.
		That&apos;ll throw off the personal exploration quest locations though, which&apos;ll be a bit sad.
		I kind of grew attached to the place mine ended up in the test world.
		It was a decent-sized dungeon in a beautiful lava cave very distant from the spawn area, especially in a vertical direction.
		It was deep enough that I could call it home (anywhere below -1024 is great), but not neat the bottom of the world.
		(The bottom of the world would take an obnoxious amount of time to dig to, given that I&apos;m building a decent tunnel to get to my quest area, not simply digging a one by one pit.)
		I should try not to get too attached until everything&apos;s finalised this time.
	</p>
	<p>
		Some strange person came through the drive-through and offered me a &quot;bud&quot;.
		I&apos;m thinking that was whatever drug they were smoking in their van, most likely marijuana.
		I&apos;m not familiar with drug terminology though.
	</p>
	<p>
		Once I got back home, I found a couple mattresses out by the dumpster.
		They seem to be in decent condition, though a little dirty.
		They&apos;re not the type I&apos;m used to with the internal metal frame, so it should be interesting to see how they work out.
		They&apos;re big though, maybe queen sized, so I&apos;ll need to find some sheets for them.
		I&apos;ll clean off all the leaves and debris later when I have time, but tonight, I just want to record my thoughts and go to bed.
	</p>
	<p>
		My <a href="/a/canary.txt">canary</a> still sings the tune of freedom and transparency.
	</p>
</section>
END
);
